<?php
/**
 * @package WordPress
 * @subpackage LRC-Library_Theme
 */
/*
Template Name: Books List Page
*/
?>
<?php get_header(); ?>	<?php if(function_exists('bookSubmit')): ?>
<?php if (have_posts()) :?><h1>This is Books List</h1> <br />

<?php while (have_posts()) : the_post(); ?>
<?php

	$myposts = get_posts('numberposts=110&offset=0&orderby=date');

	$postshtmlcount = 0;
	echo '<table border="5" cellpadding="5" cellspacing="15" width="80%" cols="6"><tr><td>ID:</td><td>Title:</td><td>Authors</td><td>Cat</td><td>Tags</td><td>listed Date</td></tr>';
	foreach($myposts as $post){
		$custom = get_post_custom($post->ID);
		$thumb = $custom['book-thumb'][0];
		$id= $custom['bookid'][0];
		$authors= $custom['bookauthors'][0];

		if($thumb and ($postshtmlcount = ++$postshtmlcount)){
			$postshtmlcount++;

			?><tr><td><a href="<?php the_permalink() ?>" title="<?php printf(__("Permanent Link to %s", "wpbl"), the_title_attribute('echo=0')); ?>"><?php echo $id; ?></a></td>
<td><a href="<?php the_permalink() ?>" title="<?php printf(__("Permanent Link to %s", "wpbl"), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></td>
<td><a href="<?php echo $authors; ?>"><?php echo $authors; ?></a></td>
<td>				<?php if ( count( get_the_category() ) ) : ?>	
<?php printf( __( '%1$s'), get_the_category_list( ', ' ) ); ?>
				<?php endif; ?></td>
<td>				<?php
					$tags_list = get_the_tag_list( '', ', ' );
					if ( $tags_list ):
				?>
				<?php printf($tags_list); ?><?php endif; ?></td>
				<td><a href="<?php echo get_day_link($thisyear, $thismonth, $day);?>"><?php  the_time(get_option('date_format')); ?></a>	</td>
</tr>

<?php
}					
	}echo'</table></div>';   
?> 
<?php endwhile; else: ?>

<div class="entry">
<p><?php _e('Sorry, no posts matched your criteria.','wpbl'); ?></p>
</div>

<?php endif; ?>
<?php else: echo "You did not install or activate <strong>Video Swiper Plugins.</strong> So you can't view this page."; endif; ?> 
<?php get_footer(); ?>